package com.wuxiaofan.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.order.entity.RefundInfo;
import com.wuxiaofan.order.entity.custom.RefundInfoCustom;
import com.wuxiaofan.order.mapper.RefundInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.order.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class RefundInfoService {
    @Autowired
    private RefundInfoMapper omsRefundInfoMapper;
    @Resource
    private Idgenerator idgenerator;
    public RefundInfo findById(String id){
        return omsRefundInfoMapper.selectById(id);
    }

    public RefundInfoCustom findCountByMap(Map paraMap){
        return omsRefundInfoMapper.findCountByMap(paraMap);
    }

    public RefundInfoCustom findGroupByMap(Map paraMap){
        return omsRefundInfoMapper.findGroupByMap(paraMap);
    }

    public List<RefundInfoCustom> findByMap(Map paraMap){
        return omsRefundInfoMapper.findByMap(paraMap);
    }

    public Page<RefundInfoCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(omsRefundInfoMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        omsRefundInfoMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        omsRefundInfoMapper.deleteById(id);
    }

    public RefundInfo save(RefundInfo omsRefundInfo){
        omsRefundInfo.setId(idgenerator.getId());
        omsRefundInfoMapper.insert(omsRefundInfo);
        return omsRefundInfo;
    }

}
